package com.yanh.common.exception;

import com.yanh.common.enums.ResultCode;
import lombok.Getter;

@Getter
public class CommonException extends RuntimeException{
    private ResultCode code;

    public CommonException(String message, ResultCode code) {
        super(message);
        this.code = code;
    }

    public CommonException(String message, Throwable cause, ResultCode code) {
        super(message, cause);
        this.code = code;
    }

    public CommonException(Throwable cause, ResultCode code) {
        super(cause);
        this.code = code;
    }

    public ResultCode getErrorCode() {
        return code;
    }
}
